package com.ler.yrmall.coupon.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ler.yrmall.basic.Form;
import com.ler.yrmall.coupon.entity.SpuBoundsEntity;
import com.ler.yrmall.coupon.mapper.SpuBoundsMapper;
import com.ler.yrmall.coupon.service.SpuBoundsService;
import com.ler.yrmall.coupon.vo.SpuBoundsVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;


@Service("spuBoundsService")
public class SpuBoundsServiceImpl extends ServiceImpl<SpuBoundsMapper, SpuBoundsEntity> implements SpuBoundsService {

    @Override
    public IPage<SpuBoundsVO> queryPage(Form form) {
        IPage<SpuBoundsEntity> page = this.page(form.getPage());
        return page.convert(e -> {
            SpuBoundsVO target = new SpuBoundsVO();
            BeanUtils.copyProperties(e,target);
            return target;
        });
    }

}